import React from 'react';
import { Modal, Button, Space } from 'antd';
import { SvgIcon } from '@/components/icon';

interface DeleteConfirmModalProps {
  visible: boolean;
  loading?: boolean;
  text: string | React.ReactNode;
  onCancel: () => void;
  onConfirm: () => void;
  onCancelText?: string; // 可选参数
  onConfirmText?: string; // 可选参数
}

const DeleteConfirmModal: React.FC<DeleteConfirmModalProps> = ({
  visible,
  loading = false,
  text,
  onCancel,
  onConfirm,
  onCancelText = '取消', // 默认值
  onConfirmText = '删除', // 默认值
}) => {
  return (
    <Modal
      open={visible}
      onCancel={onCancel}
      closable={false}
      width={400}
      title={'提示'}
      footer={
        <div style={{ textAlign: 'center' }}>
          <Space size={30}>
            <Button onClick={onCancel}>{onCancelText}</Button>
            <Button type="primary" danger loading={loading} onClick={onConfirm}>
              {onConfirmText}
            </Button>
          </Space>
        </div>
      }
    >
      <div
        style={{
          display: 'flex',
          justifyContent: 'center',
          alignItems: 'center',
          height: '80px',
        }}
      >
        <SvgIcon icon="hugeicons--alert-02" color="#6E35FF" size={24} />
        <div
          style={{ textAlign: 'center', fontWeight: 'bold', fontSize: '18px' }}
          className="ml-2 "
        >
          {text}
        </div>
      </div>
    </Modal>
  );
};

export default DeleteConfirmModal;
